home *** CD-ROM | disk | FTP | other *** search
/ IBM InfoROM for OS/2 Beta 1995 January / IBM InfoROM for OS2 Beta 1-1995.ISO / testcert / mmedia / system / ap2 / scripts / wrj____6.p2s < prev    next >
Encoding:
Text File  |  1994-05-05  |  2.7 KB  |  115 lines

  1. ###############################################################
  2. # OBJECTIVE:
  3. #
  4. # Description:  Open the wave player, load, set record settings,
  5. # record, seek, play, save, close .
  6. #
  7. # *** Wave Record from Microphone with Monitor input disabled.
  8. #      BITS PER SAMPLE -  8  
  9. #      SAMPLES PER SEC - 11.025Khz  
  10. #      CHANNELS - 2      
  11. #      FORMAT TAG - MULAW   
  12. #
  13. ###############################################################
  14.  
  15. ############################################
  16. #
  17. #   OPEN THE DIGITAL AUDIO PLAYER
  18. #   WAIT FOR SUCCESSFUL OPEN
  19. #
  20. ############################################
  21.  
  22. open waveaudio00 alias wave1 shareable notify
  23. +MM_MCINOTIFY MCI_NOTIFY_SUCCESSFUL MCI_OPEN #1
  24. @WAIT_NOTIFY 1 5000
  25.  
  26. connection wave1 query type wave stream alias amp wait
  27.  
  28. ############################################
  29. #
  30. #   LOAD A NEW FILE TO BE RECORDED
  31. #
  32. ############################################
  33.  
  34. load wave1 new notify
  35. +MM_MCINOTIFY MCI_NOTIFY_SUCCESSFUL MCI_LOAD #2
  36. @WAIT_NOTIFY 2 30000
  37.  
  38. ############################################
  39. #
  40. #   SET THE DIGITAL AUDIO PLAYER
  41. #   TIME FORMAT - MILLISECONDS
  42. #   BITS PER SAMPLE -  8  
  43. #   SAMPLES PER SEC - 11.025Khz  
  44. #   CHANNELS - 2      
  45. #   FORMAT TAG - MULAW   
  46. #   Monitor Input disabled
  47. #
  48. ############################################
  49.  
  50. set wave1 time format milliseconds wait
  51. status wave1 time format wait
  52. =milliseconds
  53.  
  54. set wave1 bitspersample 8 wait
  55. status wave1 bitspersample wait
  56. =8
  57.  
  58. set wave1 samplespersec 11025 wait
  59. status wave1 samplespersec wait
  60. =11025
  61.  
  62. set wave1 channels 2 wait
  63. status wave1 channels wait
  64. =2
  65.  
  66. set wave1 format tag MULAW wait
  67. status wave1 format tag wait
  68. =MULAW
  69.  
  70. set amp MONITOR OFF wait
  71. status amp MONITOR wait
  72. =false
  73.  
  74. connector wave1 enable type microphone wait
  75.  
  76. ############################################
  77. #
  78. #   RECORD THE NEW WAVE FILE
  79. #
  80. ############################################
  81.  
  82. record wave1 from 0 to 10000 notify
  83. +MM_MCINOTIFY MCI_NOTIFY_SUCCESSFUL MCI_RECORD #3
  84.  
  85. stop wave1 wait
  86. @WAIT_NOTIFY 3 20000
  87.  
  88. ############################################
  89. #   SEEK TO START
  90. #   PLAY THE NEW RECORDED FILE
  91. ############################################
  92.  
  93. seek wave1 to 0 wait
  94. status wave1 position wait
  95. =0
  96. play wave1 notify
  97. +MM_MCINOTIFY MCI_NOTIFY_SUCCESFUL MCI_PLAY #4
  98. @WAIT_NOTIFY 4 40000
  99.  
  100. #Save the recored file 
  101. save wave1 delete.wav notify
  102. +MM_MCINOTIFY MCI_NOTIFY_SUCCESSFUL MCI_SAVE #5
  103. @WAIT_NOTIFY 5 5000
  104.  
  105. ############################################
  106. #
  107. #   CLOSE THE DIGITAL AUDIO PLAYER AND
  108. #   EXPECT A SUCCESSFUL CLOSE
  109. #
  110. ############################################
  111.  
  112. close wave1 notify
  113. +MM_MCINOTIFY MCI_NOTIFY_SUCCESSFUL MCI_CLOSE #6
  114. @WAIT_NOTIFY 6 25000
  115.